﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace Exchange
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox2.Text = "";
            string str = textBox1.Text;
            string[] ContentLines = str.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < ContentLines.Length; i++)
            {
                textBox2.Text += Regex.Replace(ContentLines[i].Replace(" ", ""), "([^=]*)=([^;]*)", "$2=$1") + "\r\n";
            }

            textBox2.SelectAll();
            textBox2.Copy();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
        }
    }
}
